VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsDirectiveTracking"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Option Explicit

Public Function GetDirectiveDetails(ByVal nDirectiveNumber As String) As recordSet

Dim adoConn As ADODB.Connection
Dim adoRSDirDetails As ADODB.recordSet
Dim adoComm As ADODB.Command

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoRSDirDetails = New ADODB.recordSet
With adoRSDirDetails
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = "dir_get_directive_details"
    .CommandType = adCmdStoredProc
    Set .ActiveConnection = adoConn
    .Parameters.Append .CreateParameter("directive_number", adVarChar, adParamInput, 15, CStr(nDirectiveNumber))
End With
    
Set adoRSDirDetails = adoComm.Execute

'Clean up
Set adoRSDirDetails.ActiveConnection = Nothing
adoConn.Close
Set GetDirectiveDetails = adoRSDirDetails
Set adoConn = Nothing
Set adoComm = Nothing


End Function

Public Function ValidateCancel(ByVal Username As String, ByVal nDirectiveNumber As String) As recordSet

Dim adoConn As ADODB.Connection
Dim adoRSValCancel As ADODB.recordSet
Dim adoComm As ADODB.Command

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoRSValCancel = New ADODB.recordSet
With adoRSValCancel
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = "dir_validate_cancel"
    .CommandType = adCmdStoredProc
    Set .ActiveConnection = adoConn
    .Parameters.Append .CreateParameter("username", adVarChar, adParamInput, 10, Username)
    .Parameters.Append .CreateParameter("directive_number", adVarChar, adParamInput, 15, CStr(nDirectiveNumber))
End With
    
Set adoRSValCancel = adoComm.Execute

'Clean Up
Set adoRSValCancel.ActiveConnection = Nothing
adoConn.Close
Set ValidateCancel = adoRSValCancel
Set adoConn = Nothing
Set adoComm = Nothing

End Function

Public Function GetIT88Details(ByVal nReqSeqNum As String) As recordSet

Dim adoConn As ADODB.Connection
Dim adoRSIT88Details As ADODB.recordSet
Dim adoComm As ADODB.Command

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoRSIT88Details = New ADODB.recordSet
With adoRSIT88Details
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = "dir_get_it88_detail"
    .CommandType = adCmdStoredProc
    Set .ActiveConnection = adoConn
    .Parameters.Append .CreateParameter("req_seq_num", adDouble, adParamInput, , nReqSeqNum)
End With
    
Set adoRSIT88Details = adoComm.Execute

'Clean Up
Set adoRSIT88Details.ActiveConnection = Nothing
adoConn.Close
Set GetIT88Details = adoRSIT88Details
Set adoConn = Nothing
Set adoComm = Nothing

End Function

Public Function GetFundInfo(ByVal nFundID As String) As recordSet

Dim adoConn As ADODB.Connection
Dim adoRSFundInfo As ADODB.recordSet
Dim adoComm As ADODB.Command

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoRSFundInfo = New ADODB.recordSet
With adoRSFundInfo
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = "dir_get_fund_id_details"
    .CommandType = adCmdStoredProc
    Set .ActiveConnection = adoConn
    .Parameters.Append .CreateParameter("fun_id", adDouble, adParamInput, , nFundID)
End With
    
Set adoRSFundInfo = adoComm.Execute

'Clean Up
Set adoRSFundInfo.ActiveConnection = Nothing
adoConn.Close
Set GetFundInfo = adoRSFundInfo
Set adoConn = Nothing
Set adoComm = Nothing


End Function

Public Function GetEmpInfo(ByVal nEmpID As String) As recordSet

Dim adoConn As ADODB.Connection
Dim adoRSEmpInfo As ADODB.recordSet
Dim adoComm As ADODB.Command

Set adoConn = New ADODB.Connection
With adoConn
    .CursorLocation = adUseClient
    .ConnectionString = GetConnectionString() 'Johann (20090625): Centralised code for connection string added
    .Open
End With

Set adoRSEmpInfo = New ADODB.recordSet
With adoRSEmpInfo
    .CursorLocation = adUseClient
    .CursorType = adOpenStatic
End With

Set adoComm = New ADODB.Command
With adoComm
    .CommandText = "dir_get_employer_id_details"
    .CommandType = adCmdStoredProc
    Set .ActiveConnection = adoConn
    .Parameters.Append .CreateParameter("emp_id", adDouble, adParamInput, , nEmpID)
End With
    
Set adoRSEmpInfo = adoComm.Execute

'Clean Up
Set adoRSEmpInfo.ActiveConnection = Nothing
adoConn.Close
Set GetEmpInfo = adoRSEmpInfo
Set adoConn = Nothing
Set adoComm = Nothing

End Function

